﻿namespace GarminUtils
{
    public static class Constant
    {
        /// <summary>  
        /// 文件后缀  
        /// </summary>  
        public static class FileSuffix
        {
            public const string FIT = "fit";
            public const string GPX = "gpx";
            public const string TCX = "tcx";
        }

        /// <summary>  
        /// 下载目录  
        /// </summary>  
        public const string DownloadDir = "./garmin_fit_files";

        /// <summary>  
        /// 数据库路径  
        /// </summary>  
        public const string DbFilePath = "./db/garmin.db";

        /// <summary>  
        /// AES加密密钥  
        /// </summary>  
        public const string AesKeyDefault = "LSKDAJALSD";

        /// <summary>  
        /// GARMIN ACCOUNT  
        /// </summary>  
        // 佳明中国区账号及密码  
        public static readonly string GarminUsernameDefault = Environment.GetEnvironmentVariable("GARMIN_USERNAME_DEFAULT") ?? string.Empty;
        public static readonly string GarminPasswordDefault = Environment.GetEnvironmentVariable("GARMIN_PASSWORD_DEFAULT") ?? string.Empty;

        // 佳明国际区账号及密码  
        public static readonly string GarminGlobalUsernameDefault = Environment.GetEnvironmentVariable("GARMIN_GLOBAL_USERNAME_DEFAULT") ?? string.Empty;
        public static readonly string GarminGlobalPasswordDefault = Environment.GetEnvironmentVariable("GARMIN_GLOBAL_PASSWORD_DEFAULT") ?? string.Empty;

        // 佳明迁移数量配置  
        public static readonly int GarminMigrateNumDefault = int.Parse(Environment.GetEnvironmentVariable("GARMIN_MIGRATE_NUM_DEFAULT") ?? "0");
        public static readonly int GarminMigrateStartDefault = int.Parse(Environment.GetEnvironmentVariable("GARMIN_MIGRATE_START_DEFAULT") ?? "0");

        // 佳明每次同步时检查的最多的数量  
        public const int GarminSyncNumDefault = 10;

        /// <summary>  
        /// 佳明URL  
        /// </summary>  
        public static readonly IReadOnlyDictionary<string, string> GarminUrlDefault = new Dictionary<string, string>
        {
            ["BASE_URL"] = "https://connect.garmin.cn",
            ["ACTIVITY_URL"] = "https://connect.garmin.cn/modern/activity/",
            ["SSO_URL_ORIGIN"] = "https://sso.garmin.com",
            ["SSO_URL"] = "https://sso.garmin.cn/sso",
            ["MODERN_URL"] = "https://connect.garmin.cn/modern",
            ["SIGNIN_URL"] = "https://sso.garmin.cn/sso/signin",
            ["CSS_URL"] = "https://static.garmincdn.cn/cn.garmin.connect/ui/css/gauth-custom-v1.2-min.css"
        };
    }
}

